﻿using Dapper;
using Estsh.Core.Base;
using Estsh.Core.Dapper;
using Estsh.Core.Wms.IRepositories;
using Estsh.Core.Model.Result;
using Estsh.Core.Repositories;
using System.Collections;
using System.Data;
using System.Text;
using System.Security.Cryptography;
using System.Text.Json;
using Estsh.Core.Models;
using Newtonsoft.Json.Linq;
using Estsh.Core.Model.EnumUtil;

namespace Estsh.Core.Wms.Repositories
{
    public class PdlineRepository : BaseRepository<SysPdline>, IPdlineRepository
    {
        public PdlineRepository(DapperDbContext _dapperDbContext) : base(_dapperDbContext)
        {

        }
        /// <summary>
        /// 获取产线信息
        /// </summary>
        /// <returns></returns>
        public List<SysPdline> GetPdlineInfo()
        {
            using (IDbConnection dbConn = dapperDbContext.GetDbConnection())
            {
                if (dbConn.State == ConnectionState.Closed)
                {
                    dbConn.Open();
                }

                StringBuilder sql = new StringBuilder(1024);
                sql.Append("SELECT * FROM dbo.sys_pdline (nolock) ");
                sql.Append("WHERE enabled = 'Y' ");

                return dbConn.Query<SysPdline>(sql.ToString()).ToList();
            }
        }
    }
}
